const express =require('express')
const router=express.Router()
const userinfo_handler=require('../router_handler/userinfo')
const expressJoi=require('@escook/express-joi')
// 导入校检规则模块
const {update_userinfo_schema,reset_Password_schema,update_avatar_schema}=require('../schema/userinfo')
//获取用户基本信息
router.get('/userinfo',userinfo_handler.getUserInfo)
// 更新用户的数据
router.post('/userinfo',expressJoi(update_userinfo_schema),userinfo_handler.updateUserInfo)
// 重置密码
router.post('/updatepwd',expressJoi(reset_Password_schema),userinfo_handler.updatePassword)
// 更新头像
router.post('/update/avatar',expressJoi(update_avatar_schema),userinfo_handler.updateAvatar)

module.exports=router